package TetrisFlash.Objects.Tetrominoes 
{
	import TetrisFlash.Objects.TetrisBoard.TetrisBoard;
	import TetrisFlash.Screen.Screen;
	import TetrisFlash.GlobalData.Global;
	/**
	 * ...
	 * @author DANTRUONG
	 */
	public class TetrominoI extends ITetromino 
	{
		
		public function TetrominoI(_screen: Screen) 
		{
			tetrominoID =  Global.ID_TETROMINO_I;
			column = 4;
			row = 1;
			
			super(_screen);
			
			//Create value of array for I
			tetrominoArray[0][0] = tetrominoArray[1][0] = tetrominoArray[2][0] =
			tetrominoArray[3][0] = tetrominoID;
		}
		
		//Return result rotation with calculated offset
		override public function isRotation(tBoard: TetrisBoard, dx:int = 0, dy:int = 0): Boolean {
			var dx:int, dy:int;
			if (column > row) {
				dx = 2;
				dy = -2;
			}else {
				dx = -2;
				dy = 2;
			}
			return super.isRotation(tBoard, dx, dy);	
		}
	}

}